<?php
/* 
 * Module abstract class
 */
abstract class Module
{
    protected $config = null;
    private $view = null;
    public function setConfigInstance(Core $config)
    {
        $this->config = $config;
        $this->view = new Dwoo();
        $this->view->setCompileDir(
            $this->config->Value("template_compilation")
        );
    }
    protected function Display($template, $variables=array(), $display=true)
    {
        $tpl = new Dwoo_Template_File($this->config->Value("template_path") .
                DIRECTORY_SEPARATOR .$template);
        $data = new Dwoo_Data();
        $data->setData($variables);
        if(!$display)
            return $this->view->get($tpl, $data);
        else
            $this->view->output ($tpl, $data);
    }
    abstract public function index();
}
?>